package com.n9.buymsg.service.qqonline;

import com.n9.buymsg.AppContext;
import com.n9.buymsg.service.qqonline.converter.FilterChain;

/**
 * 过滤器链工厂类
 * @Author: ice
 * @Date: 2020-07-06 17:33
 */
public class FilterChainFactory {

    /**
     * 创建过滤器链
     * @return
     */
    public static FilterChain create() {
        DefaultFilterChain filterChain = new DefaultFilterChain(new RemoteStorePurchaseMessageService());
        AppContext appContext = AppContext.getInstance();
        filterChain.addFilter(appContext.getMsgTypeFilter());
        filterChain.addFilter(appContext.getMsgBodyFilter());
        return filterChain;
    }
}
